<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Yy


    </title>
</head>

<body>
    <script>
        // 编写正则表达式，1、用于验证电话号码；
        var reg_One = /^[1]{1}[0-9]{10}$/
        var phone_Num = "17334598762";
        console.log(reg_One.test(phone_Num));
        // 2、 编写正则表达式，用于验证邮箱格式。
        var email = "1941263063@qq.com"
        var reg_Two = /^[a-zA-Z0-9\_]{5,12}\@[a-zA-Z0-9]{2,5}\.com$/
        if (reg_Two.test(email)) {
            console.log("通过验证")
        } else {
            console.log("验证失败")
        }
    </script>
</body>

</html>